package cc.deng.wubo.minapp.beans.game;

import cc.deng.wubo.minapp.core.base.BaseModel;
import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*;
import org.nutz.json.JsonField;

@Table("gm_user")
public class GmUser extends BaseModel{

    @Id
    //@JsonField(forceString = true)
    @Prev({
            @SQL(db= DB.MYSQL,value = "SELECT IFNULL(MAX(id),0)+1 FROM gm_user"),
            @SQL(db= DB.ORACLE,value = "SELECT COALESCE(MAX(id),0)+1 FROM gm_user")
    })
    @Column
    private Long id;
    @Column
    @Comment("微信openid")
    private String openId;
    @Column
    @Comment("用户昵称")
    private String nickName;
    @Column
    @Comment("性别")
    private String gender;
    @Column
    @Comment("城市")
    private String city;
    @Column
    @Comment("省份")
    private String province;
    @Column
    @Comment("县")
    private String country;
    @Column
    @Comment("用户头像uil")
    private String avatarUrl;
    @Column
    @Comment("微信unionId")
    private String unionId;

    @Column
    @Comment("用户拓展表Id")
    private Long gmUserInfoId;

    @One(field = "gmUserInfoId")
    private GmUserInfo gmUserInfo;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getAvatarUrl() {
        return avatarUrl;
    }

    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public String getUnionId() {
        return unionId;
    }

    public void setUnionId(String unionId) {
        this.unionId = unionId;
    }

    public Long getGmUserInfoId() {
        return gmUserInfoId;
    }

    public void setGmUserInfoId(Long gmUserInfoId) {
        this.gmUserInfoId = gmUserInfoId;
    }

    public GmUserInfo getGmUserInfo() {
        return gmUserInfo;
    }

    public void setGmUserInfo(GmUserInfo gmUserInfo) {
        this.gmUserInfo = gmUserInfo;
    }
}
